package com.bzy.service;

import com.bzy.User;
import com.bzy.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ Author     : Bzy.
 * @ Date       : 2020/12/28 -- 16:17
 * @ Version:     $ 1.0
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public List<User> getAllUser() {
        return userMapper.selectAllUser();
    }

    @Override
    public Integer addOneUser(User user) {
        return userMapper.insertOneUser(user);
    }

    @Override
    public Integer setOneUser(User user) {
        return userMapper.updateOneUser(user);
    }

    @Override
    public Integer delOneUser(Integer uid) {
        return userMapper.deleteOneUser(uid);
    }
}
